<template>
  <div class="home">
    <!-- <img alt="Vue logo" src="../assets/logo.png"> -->
    <!-- <div class="box"></div> -->

    <!-- <div class="pox"></div> -->

    <!-- <van-button type="primary">主要按钮</van-button>
    <van-button type="info">信息按钮</van-button>
    <van-button type="default">默认按钮</van-button>
    <van-button type="warning">警告按钮</van-button>
    <van-button type="danger" @click="show = !show">危险按钮</van-button>
    <van-calendar v-model="show" @confirm="onConfirm" />
    <HelloWorld msg="Welcome to Your Vue.js App" /> -->
    <router-view></router-view>
    <Tabbar />
  </div>
</template>

<script>
// @ is an alias to /src
import { smsCode } from "@/http/api";
import Tabbar from "@/components/tabbar.vue";
export default {
  name: "Home",
  components: {
    Tabbar,
  },
  data() {
    return {
      date: "",
      show: true,
    };
  },
  async created() {
    // let loading = this.$toast.loading({
    //   duration: 10000,
    //   message: "加载中...",
    //   forbidClick: true,
    // });
    // service
    //   .post("/smsCode", {
    //     mobile: 16619965544,
    //     sms_type: "login",
    //   })
    //   .then((res) => {
    //     console.log(res);
    //   });
    // let res = await this.$axios.post(
    //   "http://120.53.31.103:84/api/app/smsCode",
    //   { mobile: 16619965544, sms_type: "login" }
    // );
    // let res =await smsCode({ mobile: 16619965544, sms_type: "login" });
    // console.log(res);
    // loading.clear();
    // let res = await smsCode({ mobile: 16619965544, sms_type: "login" });
    // console.log(res);
  },
  methods: {
    formatDate(date) {
      return `${date.getMonth() + 1}/${date.getDate()}`;
    },
    onConfirm(date) {
      this.show = false;
      this.date = this.formatDate(date);
      console.log(this.date);
    },
  },
};
</script>

<style>
.box {
  width: 375px;
  height: 200px;
  background: red;
}
/* .pox {
  width: 50vw;
  height: 100vh;
  background: green;
} */
</style>
